<template>
  <div>
    <div>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="">
          <el-button type="primary" @click="addimg">添加公司</el-button>
        </el-form-item>
        <!-- <el-form-item label="">
          <el-button type="primary" @click="save">保存</el-button>
        </el-form-item> -->
      </el-form>
    </div>
    <div>
      <el-table :data="table" style="width: 100%">
        <el-table-column type="index" label="序号" align="center" width="250" />
        <el-table-column prop="name" label="公司名称" align="center" width="300" />
        <el-table-column prop="title" label="公司标题" align="center" width="250" />
      </el-table>
    </div>
  </div>
</template>
<script lang="js" setup>
import {onMounted,ref} from 'vue'
import {useRouter} from 'vue-router'
import {getcompanys} from '@/api/user'
onMounted(async () => {
 const res = await getcompanys()
 table.value = res.data
})
const table = ref([])
const router = useRouter()
const addimg = () => {
  router.push('/service/companyedit')
}
</script>
